package com.shop.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.pojo.oms.Oms_Order;
import com.shop.pojo.oms.Oms_Order_Setting;
import com.shop.service.Oms_Order_Setting_Service;
import com.shop.utils.LayuiUtils;
import com.shop.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 订单的配置信息
 */
@RestController
@RequestMapping("/order_setting")
public class Oms_Order_Setting_Controller {

    @Autowired
    private Oms_Order_Setting_Service oms_order_setting_service;

    /**
     * 后台的显示订单配置信息
     * @param page
     * @param limit
     * @param os
     * @return
     */
    @GetMapping("/find_admin_order_setting_All")
    public LayuiUtils<Oms_Order_Setting>  find_admin_order_setting_All(Integer page,Integer limit,Oms_Order_Setting os){

        Page<Oms_Order_Setting>  PAGES= new Page<>();

        return oms_order_setting_service.find_admin_order_setting_All(PAGES,os);

    }

    /***
     * 修改订单的可配置信息
     * @param os
     * @return
     */
    @PutMapping("/up_admin_order_setting_All")
    public R up_admin_order_setting_All(@RequestBody Oms_Order_Setting os){
        System.out.println(os);
        return oms_order_setting_service.up_admin_order_setting_All(os);
    }

    /**
     * 查询订单的配置信息进行显示
     * @param id
     * @return
     */
    @GetMapping("/find_admin_Setting_Dan/{id}")
    public Oms_Order_Setting find_admin_Setting_Dan(@PathVariable("id") Long id){
        return oms_order_setting_service.find_admin_Setting_Dan(id);
    }


}
